$('#dyMobileButton').click(function () {

    var email = $("#email").val();
    // 发送异步请求(POST)
    $.post(
        CONTEXT_PATH + "/sendMail",
        {"email":email},
        function(data) {
            data = $.parseJSON(data);
            console.info(data);
            if(data.code==0){
                var time=60;
                var timer = setInterval(function () {
                    time--;
                    if (time > 0){
                        //正在倒计时
                        $('#dyMobileButton').html('重新发送' + time + '秒');
                        $('#dyMobileButton').prop('disabled',true);
                    }else{
                        $('#dyMobileButton').html('发送验证码');
                        $('#dyMobileButton').prop('disabled',false);
                        clearInterval(timer);
                    }
                },1000);
            }else{
                $("#email").attr("class","form-control is-invalid");
                document.getElementById('mailMsg').innerHTML=data.msg;
                //$("#mailMsg").innerHTML=data.msg;
            }


        }
    );




})